package cn.iocoder.yudao.module.game.dal.mysql.agentTeam;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.game.dal.dataobject.agentTeam.AgentTeamDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.game.controller.admin.agentTeam.vo.*;

/**
 * 代理团队 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AgentTeamMapper extends BaseMapperX<AgentTeamDO> {

    default PageResult<AgentTeamDO> selectPage(AgentTeamPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AgentTeamDO>()
                .eqIfPresent(AgentTeamDO::getAccount, reqVO.getAccount())
                .likeIfPresent(AgentTeamDO::getName, reqVO.getName())
                .eqIfPresent(AgentTeamDO::getShareCode, reqVO.getShareCode())
                .eqIfPresent(AgentTeamDO::getShareLink, reqVO.getShareLink())
                .betweenIfPresent(AgentTeamDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AgentTeamDO::getId));
    }

}